package com.neusoft.ysu.npms.controller;


import com.neusoft.ysu.npms.pojo.Category;
import com.neusoft.ysu.npms.pojo.Firstrisk;
import com.neusoft.ysu.npms.pojo.Result;
import com.neusoft.ysu.npms.pojo.Risk;
import com.neusoft.ysu.npms.service.IFirstriskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者：刘金秋
 * @since 2024-06-18
 */
@RestController
@RequestMapping("/firstrisk")
public class FirstriskController {
    @Autowired
    IFirstriskService ifirstriskService;
    @RequestMapping("/add")
    public Result add(@RequestBody Firstrisk firstrisk) {ifirstriskService.add(firstrisk);return Result.success();}
    @RequestMapping("/delete")
    public Result deleteFrisk(@RequestBody Firstrisk firstrisk) {ifirstriskService.deleteFrisk(firstrisk);return Result.success();}
    @RequestMapping("/update")
    public Result updateFrisk(@RequestBody Firstrisk firstrisk){ifirstriskService.updateFrisk(firstrisk);return Result.success();}
    @RequestMapping("/getAll")
    public Result getAll(){
        return ifirstriskService.selectAll();}
    @RequestMapping("/findone")
    public Result findone(@RequestBody Firstrisk firstrisk){System.out.println(firstrisk);ifirstriskService.findById(firstrisk);return Result.success();}
    @GetMapping("/select")
    public Result<Firstrisk> firstInfo(){
        Firstrisk firstrisk = ifirstriskService.select();
        return Result.success();
    }
}
